+2007-11-26 Tor Lillqvist <tml@novell.com>
+
+ * gdk/win32/gdkwindow-win32.c (gdk_window_fullscreen): Use the
+ monitor the window currently is on, not always the primary
+ monitor. (#463865, Tim Evans)
+
2007-11-26 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdktestutils-win32.c: New file, dummy implementations.
void
gdk_window_fullscreen (GdkWindow *window)
{
- gint width, height;
+ gint x, y, width, height;
FullscreenInfo *fi;
GdkWindowObject *private = (GdkWindowObject *) window;
+ HMONITOR monitor;
+ MONITORINFO mi;
g_return_if_fail (GDK_IS_WINDOW (window));
{
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
- width = GetSystemMetrics (SM_CXSCREEN);
- height = GetSystemMetrics (SM_CYSCREEN);
-
+ monitor = MonitorFromWindow (GDK_WINDOW_HWND (window), MONITOR_DEFAULTTONEAREST);
+ mi.cbSize = sizeof (mi);
+ if (monitor && GetMonitorInfo (monitor, &mi))
+ {
+ x = mi.rcMonitor.left;
+ y = mi.rcMonitor.top;
+ width = mi.rcMonitor.right - x;
+ height = mi.rcMonitor.bottom - y;
+ }
+ else
+ {
+ x = y = 0;
+ width = GetSystemMetrics (SM_CXSCREEN);
+ height = GetSystemMetrics (SM_CYSCREEN);
+ }
+
/* remember for restoring */
fi->hint_flags = impl->hint_flags;
impl->hint_flags &= ~GDK_HINT_MAX_SIZE;
(fi->style & ~WS_OVERLAPPEDWINDOW) | WS_POPUP);
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_TOP,
- 0, 0, width, height,
+ x, y, width, height,
SWP_NOCOPYBITS | SWP_SHOWWINDOW));
gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);